using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SysFrame.Message;
using System.Reflection;

namespace SysFrame.BP
{
    /// <summary>
    /// system_5方法
    /// </summary>
    public class BLLsystem_5
    {
        public Isystem_5 interface_system_5;

        public BLLsystem_5()
        {
            object obj = BPBase.GetAchieve("SysFrame.BP", "system_5");
            interface_system_5 = (Isystem_5)obj;
        }


        /// <summary>
        /// 得到system_5实体
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public List<Mssystem_5> Getsystem_5MsByQuery(MsQuery msq)
        {
            return interface_system_5.Getsystem_5MsByQuery(msq);
        }

        /// <summary>
        /// 通过System_5_10得到实体
        /// </summary>
        /// <param name="System_5_10">ID</param>
        /// <returns>实体</returns>
        public Mssystem_5 Getsystem_5MsByKey(string System_5_10)
        {
            MsQuery msquery = new MsQuery();
            msquery.strquery += " and System_5_10='" + System_5_10 + "' ";
            List<Mssystem_5> lstData = Getsystem_5MsByQuery(msquery);
            return lstData[0];
        }

        /// <summary>
        /// 得到最大字典列别编号
        /// </summary>
        /// <returns></returns>
        public string GetMaxTypeCode()
        {
            //数量
            string count = interface_system_5.GetMaxTypeCode();
            string code = "";
            try
            {
                code = (Convert.ToInt32(count)+1).ToString();
            }
            catch { }
            return code.PadLeft(3, '0');
        }

        /// <summary>
        ///  保存system_5信息
        /// </summary>
        /// <param name="ms">实体信息</param>
        /// <returns>消息</returns>
        public MsReturned Savesystem_5(Mssystem_5 ms)
        {
            return interface_system_5.Savesystem_5(ms);
        }

        /// <summary>
        /// 得到数据类型
        /// </summary>
        /// <param name="msquery">条件</param>
        /// <returns>数据类型</returns>
        public MsReturned Getsystem_5ByQuery(MsQuery msquery)
        {
            return interface_system_5.Getsystem_5ByQuery(msquery);
        }

        /// <summary>
        /// 删除system_5
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public MsReturned Deletesystem_5ByQuery(MsQuery msq)
        {
            return interface_system_5.Deletesystem_5ByQuery(msq);
        }
        /// <summary>
        /// 删除system_5
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public MsReturned Deletesystem_5ByKey(string System_5_10)
        {
            MsQuery msquery = new MsQuery();

            if (System_5_10.IndexOf(",") > 0)
            {
                msquery.strquery += " and System_5_10 in (" + System_5_10 + ") ";
            }
            else
            {
                msquery.strquery += " and System_5_10='" + System_5_10 + "' ";
            }
            return interface_system_5.Deletesystem_5ByQuery(msquery);
        }
    }
}
